
<style>
    #febs-remark-list xm-select {
        min-height: 30px;
        line-height: 30px;
    }
    #febs-remark-list xm-select > .xm-label .scroll .label-content {
        display: flex;
        padding: 0 30px 0 10px;
    }
</style>
<div class="layui-fluid layui-anim febs-anim-up" id="febs-remark-list" lay-title="提案评分">
    <div class="layui-row layui-col-space8 febs-container">
        <div class="layui-col-md12 layui-col-sm12 layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body layui-anim layui-anim-fadein">
                    <div class="layui-row welcome-info">
                        <div class="layui-col-md6 layui-col-sm12 layui-col-xs12">
                            <div class="layui-row welcome-info-wrapper">
                                <div class="user-header">
                                    <h2><span>站成提案列表</span></h2>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6 layui-col-sm12 layui-col-xs12">
                            <div class="layui-col-md-offset5">
                                <table class="login-count-table">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md12 layui-col-sm12 layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="tab_list">
                        <ul class="layui-tab-title" lay-id="tab_list">
                            <li class="layui-this" lay-id="1">未评价</li>
                            <li lay-id="2">已评价</li>
                        </ul>
                        <table class="layui-table" id="sys_list" lay-filter="sys_list" lay-size="lg"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript"  th:inline="none">
    layui.use(['dropdown', 'febs','form','element','table', 'jquery', 'xmSelect', 'laydate',], function(){
        var form = layui.form
            ,element = layui.element
            ,table = layui.table
            ,febs = layui.febs
            ,laydate = layui.laydate
            ,dropdown = layui.dropdown
            ,url = window.location.href
            ,tableIns
            ,createTimeFrom
            ,createTimeTo
            ,deptXmlSelect
            ,$= layui.$
            ,$view = $('#febs-remark-list');

        // var initTable = function(tab_id){
        //     table.render({
        function initTable(tab_id) {
            tableIns = febs.table.init({
                elem: '#sys_list'
                ,url: '/sys/list/' + tab_id
                ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                ,page:true
                ,cols: [[
                    {field: 'number', title: '项次', minWidth: 50, align: 'center', templet: function(d){  return (d.LAY_INDEX); }}
                    ,{field:'deptname',  title: '组织', minWidth: 100, align: 'center',}
                    ,{field:'ppsNo',  title: '提案编号', minWidth: 150}
                    ,{field:'ppsName',  title: '提案名称', minWidth: 200}
                    ,{field:'empnm',  title: '提案人', minWidth: 100}
                    ,{field:'ppsDate',  title: '提案日期', minWidth: 110}
                ]]
                ,even: true
                ,done: function (res, curr, count) {
                    const screenWidth = screen.width;
                    if(screenWidth < 768){
                        $("[data-field='number']").css('display','none');
                    }
                }
            });
        }
        initTable(1);//初始化表格
        document.body.eventBus.addEvent('refreshRemarkList', function() {
            initTable(1)
        })
        //监听行单击事件（双击事件为：rowDouble）
        table.on('row(sys_list)', function(obj){
            var data = obj.data;
            //标注选中样式
            obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
            if (url.indexOf("?") <= 0){
                location.href=url + "/" + data.ppsNo;
            } else {
                location.href=url.substring(0, url.indexOf("?")) + "/" + data.ppsNo;
            }
            document.body.eventBus.fireEvent('refreshRemarkDetail' + data.ppsNo)
        });

        //监听Tab切换，以改变地址hash值
        element.on('tab(tab_list)', function(){
            initTable(this.getAttribute('lay-id'));
        });
    });
</script>


